/*!
 @header OrderConfirmViewController.h
 @author 周益
 @version 1.0.0 2013/02/06 Creation
 Copyright (c) 2013年 mypocketbaby. All rights reserved.
 */

#import <UIKit/UIKit.h>
#import "OrderPickerViewController.h"
#import "CloseControllerDelegate.h"
#import "JSONRequest.h"
#import "RTLabel.h"
#import "CustomScrollView.h"
#import "AddressPickerViewController.h"

/*!
 @abstract OrderConfirmViewController为确认订单VC。用于用于修改和确认自己的订单。包括卖家姓名、商品信息、购买数量、购买金额、配送方式、收获或取货地址信息、补充说明。
 */
@interface OrderConfirmViewController : UIViewController<UITextFieldDelegate, OrderPickerViewControllerDelegate, CloseControllerDelegate, JSONRequestDelegate, UIAlertViewDelegate, CustomScrollViewDelegate, UIScrollViewDelegate, AddressPickerViewControllerDelegate>
{
    NSDictionary *_dynamic;                             //此商品的商品动态或推荐动态
    RTLabel *_amountLabel;                              //购买金额Label
    float   _amount;                                    //商品金额
    UILabel *_wayLabel;                                 //配送方式Label
    NSIndexPath *_deliveryIsSelectedIndexPath;          //配送方式被选择的indexpath，对应OrderPickerVC的IndexPath
//    NSIndexPath *_addressIsSelectedIndexPath;
    UILabel *_nameAndMobileLabel;                       //地址栏姓名和电话Label
    UILabel *_addressDetailLabel;                       //详细地址Label
    UITextField *_quantityValue;                        //购买数量TextField
    NSDictionary *_address;                             //用户当前选择的地址信息对象
    UILabel *_textLabel;                                //补充说明Label
    UITextField* _remarkField;                          //补充说明TextField
    UIView *_majorInfoView;                             //订单信息view，包括卖家卖家姓名、商品信息、购买数量、购买金额、配送方式
    UIView *_addressView;                               //地址view
    UIView *_addtionView;                               //补充说明View
                                
    UILabel *_summaryLabel;                             //收获地址或取货地址Label
    UIButton *_deliveryButton;                          //配送方式按钮，用于切换配送方式
    UIButton *_addressButton;                           //地址选择按钮，用于push到OrderPickerVC选择地址
    UIImageView *_arrowImageView_1;                     //指示箭头
    NSDictionary *_defaultConsignee;                    //默认地址对象
    JSONRequest *_orderComfirmRequest;                  //确认订单请求
    NSNumber *_consIdSelected;                          //在OrderPickerVC中默认应该被选中的地址ID
    double _inventory;                                  //商品剩余数量
    CustomScrollView *_scrollView;
    UIImageView *_lineImageView_5;
    UIView *_transportationView;
    RTLabel *_orderAmountLabel;
    UIImageView *_lineImageView_6;
    RTLabel *_pathLabel;
    UIImageView *_lineImageView_7;
    RTLabel *_fareLabel;
    UIView *_orderAmountView;
    UIButton *_commitButton;
    
    float _cityFreight;
    float _nationalFreight;
    
    double _currentFreight;                             //当前运费
    NSString *_logisticsRoutes;                         //当前物流路线
    CGFloat _offset;
    NSInteger _bearTheFreight;
    
    BOOL _deliveryMode;                                 //交货方式，YES为快递 NO为自取
    
    NSDictionary *_consignee;
}

/*!
 @abstract 自定义OrderConfirmViewController实例化方法
 @param dynamic 动态对象
 @result OrderConfirmViewController实例
 */
- (id)initWithDynamic:(NSDictionary *)dynamic;
@end
